<template>
  <div class="container">
    <div class="header-wrapper">
      <div class="header-top">
        <div class="w1190">
          <div class="header-top-text">
            卓一慧众一站式服务平台
            <a-button type="link" @click="$router.push({ name: 'index' })">返回首页</a-button>
          </div>
          <div class="header-top-component">
            <span v-if="token">您好， {{ name }} &nbsp; <a @click="logout">退出</a></span>
            <span v-else><router-link :to="{ name: 'Login' }">请登录</router-link></span>
            <a-divider type="vertical" />
            <router-link :to="{ name: 'MemberIndex' }">个人中心</router-link>
            <a-divider type="vertical" />
            咨询热线：<span>400-9932-799</span>
          </div>
        </div>
      </div>
      <div class="header-logo">
        <div class="w1190">
          <div class="logo-img">
            <router-link :to="{ name: 'index' }"><img src="@/assets/images/logo.png" /></router-link>
          </div>
          <div class="header-search">
            <a-form-model
              layout="inline"
            >
              <a-form-model-item style="margin-right:8px">
                <a-input v-model="keyword" size="large" style="width: 400px" placeholder="请输入要搜索的关键词">
                  <a-icon slot="prefix" type="search" style="color:rgba(0,0,0,.25)" />
                </a-input>
              </a-form-model-item>
              <a-form-model-item style="margin-right:8px">
                <a-button size="large" type="primary" @click="onSearch">立即查找</a-button>
              </a-form-model-item>
              <a-form-model-item style="margin-right:0">
                <a-button size="large" icon="shopping-cart" type="danger" ghost @click="$router.push({ name: 'Cart' })">
                  我的购物车
                </a-button>
              </a-form-model-item>
            </a-form-model>
          </div>
        </div>
      </div>
      <div class="header-nav">
        <div class="w1190">
          <a v-for="item in navList" :key="item.id"
             @click="$router.push({ name: 'ProductList', params:{ id: item.id } })">{{ item.name }}<img
            src="@/assets/images/icon_hot.png" /></a>
          <a @click="onSwt">国际服务</a>
          <a @click="onSwt">企业服务</a>
          <a @click="onSwt">商标交易</a>
          <a @click="onSwt">维权保护</a>
          <a @click="onSwt">商标查询</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SearchLayout',
  computed: {
    key () {
      return this.$route.path
    }
  }
}
</script>

<style scoped>

</style>